/*
 * STM32F0xx_256_2K.c
 *
 *  Created on: Apr 16, 2021
 *      Author: hello
 */
#include "flash_blob.h"
static const uint32_t flash_code[] =
{
    0XE00ABE00,0X062D780D,0X24084068,0XD3000040,0X1E644058,0X1C49D1FA,0X2A001E52,0X4770D1F2,
    0X49454846,0X49466041,0X21006041,0X68C16001,0X43112214,0X69C060C1,0XD4060740,0X49414842,
    0X21066001,0X49416041,0X20006081,0X483B4770,0X22806901,0X61014311,0X47702000,0X4837B530,
    0X241468C1,0X60C14321,0X25046901,0X61014329,0X22406901,0X61014311,0X4A334935,0X6011E000,
    0X07DB68C3,0X6901D1FB,0X610143A9,0X422168C1,0X68C1D004,0X60C14321,0XBD302001,0XBD302000,
    0X4926B530,0X231468CA,0X60CA431A,0X2402690A,0X610A4322,0X69086148,0X43102240,0X48246108,
    0XE0004A21,0X68CD6010,0XD1FB07ED,0X43A06908,0X68C86108,0XD0034018,0X431868C8,0X200160C8,
    0XB5F0BD30,0X1C494D15,0X68EB0849,0X24040049,0X60EB4323,0X4C162714,0X692BE01A,0X43332601,
    0X8813612B,0X4B108003,0X601CE000,0X07F668EE,0X692BD1FB,0X005B085B,0X68EB612B,0XD004423B,
    0X433868E8,0X200160E8,0X1C80BDF0,0X1C921E89,0XD1E22900,0XBDF02000,0X45670123,0X40022000,
    0XCDEF89AB,0X00005555,0X40003000,0X00000FFF,0X0000AAAA,0X00000000,
};

const program_target_t flash_algo_STM32F0XX =
{
    0X20000021,  // Init
    0X2000004F,  // UnInit
    0X2000005D,  // EraseChip
    0X200000A1,  // EraseSector
    0X200000E3,  // ProgramPage

    // BKPT : start of blob + 1
    // RSB  : address to access global/static data
    // RSP  : stack pointer
    {
        0X20000001,
        0X20000C00,
        0X20001000,
    },

    0x20000400,                      // mem buffer location
    0x20000000,                      // location to write prog_blob in target RAM
    sizeof(flash_code),              // prog_blob size
    flash_code,                      // address of prog_blob
    0x00000400,                      // ram_to_flash_bytes_to_be_written
};
